#include <pthread.h>
#include <iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include <unistd.h>
using namespace std;
// int pthread_create(pthread_t *thread, const pthread_attr_t *attr,void *(*start_routine) (void *), void *arg);

void printss()
{
    cout<<111<<endl;
}

void* rout(void* arg)
{
    char* threadName = static_cast<char*>(arg);
    cout<<threadName<<endl;
    while(1)
    {
        printss();
        cout<<threadName<<endl;
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    int ret = pthread_create(&tid,NULL,rout,(void*)"zk创建的线程1");
    char buffer[128];
    if(ret!=0)
    {
        snprintf(buffer,sizeof buffer , "曾奎创建的线程",1,"出错了");
    }

    while(1)
    {
        
        cout<<"主线程正在执行"<<endl;
        sleep(1);
    }

    return 0;
}